本文整理了Java中org.neo4j.string.UTF8.decode()
方法的一些代码示例,展示了UTF8.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UTF8.decode()
方法的具体详情如下:
包路径:org.neo4j.string.UTF8
类名称:UTF8
方法名:decode
暂无
代码示例来源:origin: neo4j/neo4j
public static String decodeString( byte[] byteArray )
{
return UTF8.decode( byteArray );
}
代码示例来源:origin: neo4j/neo4j
static String asValueRaw( byte[] byteArray, long long0 )
{
return byteArray == null ? null : UTF8.decode( byteArray, 0, (int) long0 );
}
代码示例来源:origin: neo4j/neo4j
public static String getDecodedStringFrom( ByteBuffer source )
{
// Currently only one key is supported although the data format supports multiple
int count = source.getInt();
int remaining = source.remaining();
if ( count > remaining )
{
throw badStringFormatException( count, remaining );
}
byte[] data = new byte[count];
source.get( data );
return UTF8.decode( data );
}
代码示例来源:origin: neo4j/neo4j
public static String readString( ReadableChannel channel, int length ) throws IOException
{
assert length >= 0 : "invalid array length " + length;
byte[] chars = new byte[length];
channel.get( chars, length );
return UTF8.decode( chars );
}
代码示例来源:origin: neo4j/neo4j
public List<S> deserializeRecords( byte[] bytes ) throws FormatException
{
return deserializeRecords( Arrays.asList( UTF8.decode( bytes ).split( "\n" ) ) );
}
代码示例来源:origin: neo4j/neo4j
private TextValue string( RecordPropertyCursor cursor, long reference, PageCursor page )
{
ByteBuffer buffer = cursor.buffer = read.loadString( reference, cursor.buffer, page );
buffer.flip();
return Values.stringValue( UTF8.decode( buffer.array(), 0, buffer.limit() ) );
}
代码示例来源:origin: neo4j/neo4j
private static String entityAsString( Response response )
{
byte[] bytes = (byte[]) response.getEntity();
return UTF8.decode( bytes );
}
代码示例来源:origin: neo4j/neo4j
private String decode( final Response response )
{
return UTF8.decode( (byte[]) response.getEntity() );
}
代码示例来源:origin: neo4j/neo4j
@Override
public Object read( ReadableClosableChannel from ) throws IOException
{
int length = from.getInt();
byte[] bytes = new byte[length]; // TODO wasteful
from.get( bytes, length );
return UTF8.decode( bytes );
}
代码示例来源:origin: neo4j/neo4j
public static String read3bLengthAndString( ReadableChannel channel ) throws IOException
{
short lengthShort = channel.getShort();
byte lengthByte = channel.get();
int length = (lengthByte << 16) | (lengthShort & 0xFFFF);
byte[] chars = new byte[length];
channel.get( chars, length );
return UTF8.decode( chars );
}
代码示例来源:origin: neo4j/neo4j
private String readFailure( File failureFile ) throws IOException
{
try ( StoreChannel channel = fs.open( failureFile, OpenMode.READ ) )
{
byte[] data = new byte[(int) channel.size()];
channel.readAll( ByteBuffer.wrap( data ) );
return UTF8.decode( withoutZeros( data ) );
}
}
代码示例来源:origin: neo4j/neo4j
@Test
public void correctRepresentation()
{
Response resp = jmxService.getServiceDefinition();
assertEquals( 200, resp.getStatus() );
String json = UTF8.decode( (byte[]) resp.getEntity() );
MatcherAssert.assertThat( json, containsString( "resources" ) );
MatcherAssert.assertThat( json, containsString( uri.toString() ) );
MatcherAssert.assertThat( json, containsString( "jmx/domain/{domain}/{objectName}" ) );
}
代码示例来源:origin: neo4j/neo4j
result[i] = UTF8.decode( buffer.array(), buffer.position(), byteLength );
buffer.position( buffer.position() + byteLength );
代码示例来源:origin: neo4j/neo4j
@Override
public Object get( long offset )
{
int length = cache.getByte( offset++, 0 ) & 0xFF;
length |= (cache.getByte( offset++, 0 ) & 0xFF) << Byte.SIZE;
ByteArray array = cache.at( offset );
byte[] bytes = new byte[length];
for ( int i = 0; i < length; )
{
int bytesLeftToRead = length - i;
int bytesLeftInChunk = (int) (chunkSize - offset % chunkSize);
int bytesToReadInThisChunk = min( bytesLeftToRead, bytesLeftInChunk );
for ( int j = 0; j < bytesToReadInThisChunk; j++ )
{
bytes[i++] = array.getByte( offset++, 0 );
}
if ( length > i )
{
array = cache.at( offset );
}
}
return UTF8.decode( bytes );
}
代码示例来源:origin: org.neo4j/neo4j-kernel
static String asValueRaw( byte[] byteArray, long long0 )
{
return byteArray == null ? null : UTF8.decode( byteArray, 0, (int) long0 );
}
代码示例来源:origin: neo4j/neo4j
assertLowest( DurationValue.duration( Period.of( Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE ) ) );
assertLowest( of( UTF8.decode( new byte[0] ) ) );
代码示例来源:origin: org.neo4j/neo4j-causal-clustering
private static File unmarshalFile( ReadableChannel channel ) throws IOException
{
byte[] name = readBytes( channel );
return new File( UTF8.decode( name ) );
}
代码示例来源:origin: org.neo4j/neo4j-causal-clustering
@Override
protected void decode( ChannelHandlerContext ctx, ByteBuf msg, List<Object> out )
{
int length = msg.readInt();
byte[] bytes = new byte[length];
msg.readBytes( bytes );
String name = UTF8.decode( bytes );
int requiredAlignment = msg.readInt();
out.add( new FileHeader( name, requiredAlignment ) );
}
}
代码示例来源:origin: org.neo4j/neo4j-common
public static String getDecodedStringFrom( ByteBuffer source )
{
// Currently only one key is supported although the data format supports multiple
int count = source.getInt();
int remaining = source.remaining();
if ( count > remaining )
{
throw badStringFormatException( count, remaining );
}
byte[] data = new byte[count];
source.get( data );
return UTF8.decode( data );
}
代码示例来源:origin: org.neo4j/neo4j-kernel
private TextValue string( RecordPropertyCursor cursor, long reference, PageCursor page )
{
ByteBuffer buffer = cursor.buffer = read.loadString( reference, cursor.buffer, page );
buffer.flip();
return Values.stringValue( UTF8.decode( buffer.array(), 0, buffer.limit() ) );
}
内容来源于网络,如有侵权,请联系作者删除!