C# 클래스 Flood.Serialization.JSONSerializer

JSON protocol implementation for thrift. This is a full-featured protocol supporting Write and Read. Please see the C++ class header for a detailed description of the protocol's wire format. Adapted from the Java version.
상속: Serializer
파일 보기 프로젝트 열기: FloodProject/flood 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
context JSONBaseContext
contextStack Stack
reader LookaheadReader
utf8Encoding System.Text.Encoding

공개 메소드들

메소드 설명
JSONSerializer ( System stream ) : System

JSONProtocol Constructor

ReadBinary ( ) : byte[]
ReadBool ( ) : bool
ReadByte ( ) : byte
ReadDataObjectBegin ( ) : DataObject
ReadDataObjectEnd ( ) : void
ReadDouble ( ) : double
ReadFieldBegin ( ) : Field
ReadFieldEnd ( ) : void
ReadI16 ( ) : short
ReadI32 ( ) : int
ReadI64 ( ) : long
ReadListBegin ( ) : TList
ReadListEnd ( ) : void
ReadMapBegin ( ) : TMap
ReadMapEnd ( ) : void
ReadString ( ) : String
WriteBinary ( byte bin ) : void
WriteBool ( bool b ) : void
WriteByte ( byte b ) : void
WriteDataObjectBegin ( DataObject str ) : void
WriteDataObjectEnd ( ) : void
WriteDouble ( double dub ) : void
WriteFieldBegin ( Field field ) : void
WriteFieldEnd ( ) : void
WriteFieldStop ( ) : void
WriteI16 ( short i16 ) : void
WriteI32 ( int i32 ) : void
WriteI64 ( long i64 ) : void
WriteListBegin ( TList list ) : void
WriteListEnd ( ) : void
WriteMapBegin ( TMap map ) : void
WriteMapEnd ( ) : void
WriteString ( String str ) : void

보호된 메소드들

메소드 설명
PopContext ( ) : void

Pop the last JSON context off the stack

PushContext ( JSONBaseContext c ) : void

Push a new JSON context onto the stack.

ReadJSONSyntaxChar ( byte b ) : void

Read a byte that must match b[0]; otherwise an exception is thrown. Marked protected to avoid synthetic accessor in JSONListContext.Read and JSONPairContext.Read

비공개 메소드들

메소드 설명
GetTypeIDForTypeName ( byte name ) : DataType
GetTypeNameForTypeID ( DataType typeID ) : byte[]
HexChar ( byte val ) : byte

Convert a byte containing a hex value to its corresponding hex character

HexVal ( byte ch ) : byte

Convert a byte containing a hex char ('0'-'9' or 'a'-'f') into its corresponding hex value

IsJSONNumeric ( byte b ) : bool

Return true if the given byte could be a valid part of a JSON number.

ReadJSONArrayEnd ( ) : void
ReadJSONArrayStart ( ) : void
ReadJSONBase64 ( ) : byte[]

Read in a JSON string containing base-64 encoded data and decode it.

ReadJSONDouble ( ) : double

Read in a JSON double value. Throw if the value is not wrapped in quotes when expected or if wrapped in quotes when not expected.

ReadJSONInteger ( ) : long

Read in a JSON number. If the context dictates, Read in enclosing quotes.

ReadJSONNumericChars ( ) : String

Read in a sequence of characters that are all valid in JSON numbers. Does not do a complete regex check to validate that this is actually a number.

ReadJSONObjectEnd ( ) : void
ReadJSONObjectStart ( ) : void
ReadJSONString ( bool skipContext ) : byte[]

Read in a JSON string, unescaping as appropriate.. Skip Reading from the context if skipContext is true.

WriteJSONArrayEnd ( ) : void
WriteJSONArrayStart ( ) : void
WriteJSONBase64 ( byte b ) : void

Write out contents of byte array b as a JSON string with base-64 encoded data

WriteJSONDouble ( double num ) : void

Write out a double as a JSON value. If it is NaN or infinity or if the context dictates escaping, Write out as JSON string.

WriteJSONInteger ( long num ) : void

Write out number as a JSON value. If the context dictates so, it will be wrapped in quotes to output as a JSON string.

WriteJSONObjectEnd ( ) : void
WriteJSONObjectStart ( ) : void
WriteJSONString ( byte b ) : void

Write the bytes in array buf as a JSON characters, escaping as needed

메소드 상세

JSONSerializer() 공개 메소드

JSONProtocol Constructor
public JSONSerializer ( System stream ) : System
stream System
리턴 System

PopContext() 보호된 메소드

Pop the last JSON context off the stack
protected PopContext ( ) : void
리턴 void

PushContext() 보호된 메소드

Push a new JSON context onto the stack.
protected PushContext ( JSONBaseContext c ) : void
c JSONBaseContext
리턴 void

ReadBinary() 공개 메소드

public ReadBinary ( ) : byte[]
리턴 byte[]

ReadBool() 공개 메소드

public ReadBool ( ) : bool
리턴 bool

ReadByte() 공개 메소드

public ReadByte ( ) : byte
리턴 byte

ReadDataObjectBegin() 공개 메소드

public ReadDataObjectBegin ( ) : DataObject
리턴 DataObject

ReadDataObjectEnd() 공개 메소드

public ReadDataObjectEnd ( ) : void
리턴 void

ReadDouble() 공개 메소드

public ReadDouble ( ) : double
리턴 double

ReadFieldBegin() 공개 메소드

public ReadFieldBegin ( ) : Field
리턴 Field

ReadFieldEnd() 공개 메소드

public ReadFieldEnd ( ) : void
리턴 void

ReadI16() 공개 메소드

public ReadI16 ( ) : short
리턴 short

ReadI32() 공개 메소드

public ReadI32 ( ) : int
리턴 int

ReadI64() 공개 메소드

public ReadI64 ( ) : long
리턴 long

ReadJSONSyntaxChar() 보호된 메소드

Read a byte that must match b[0]; otherwise an exception is thrown. Marked protected to avoid synthetic accessor in JSONListContext.Read and JSONPairContext.Read
protected ReadJSONSyntaxChar ( byte b ) : void
b byte
리턴 void

ReadListBegin() 공개 메소드

public ReadListBegin ( ) : TList
리턴 TList

ReadListEnd() 공개 메소드

public ReadListEnd ( ) : void
리턴 void

ReadMapBegin() 공개 메소드

public ReadMapBegin ( ) : TMap
리턴 TMap

ReadMapEnd() 공개 메소드

public ReadMapEnd ( ) : void
리턴 void

ReadString() 공개 메소드

public ReadString ( ) : String
리턴 String

WriteBinary() 공개 메소드

public WriteBinary ( byte bin ) : void
bin byte
리턴 void

WriteBool() 공개 메소드

public WriteBool ( bool b ) : void
b bool
리턴 void

WriteByte() 공개 메소드

public WriteByte ( byte b ) : void
b byte
리턴 void

WriteDataObjectBegin() 공개 메소드

public WriteDataObjectBegin ( DataObject str ) : void
str DataObject
리턴 void

WriteDataObjectEnd() 공개 메소드

public WriteDataObjectEnd ( ) : void
리턴 void

WriteDouble() 공개 메소드

public WriteDouble ( double dub ) : void
dub double
리턴 void

WriteFieldBegin() 공개 메소드

public WriteFieldBegin ( Field field ) : void
field Field
리턴 void

WriteFieldEnd() 공개 메소드

public WriteFieldEnd ( ) : void
리턴 void

WriteFieldStop() 공개 메소드

public WriteFieldStop ( ) : void
리턴 void

WriteI16() 공개 메소드

public WriteI16 ( short i16 ) : void
i16 short
리턴 void

WriteI32() 공개 메소드

public WriteI32 ( int i32 ) : void
i32 int
리턴 void

WriteI64() 공개 메소드

public WriteI64 ( long i64 ) : void
i64 long
리턴 void

WriteListBegin() 공개 메소드

public WriteListBegin ( TList list ) : void
list TList
리턴 void

WriteListEnd() 공개 메소드

public WriteListEnd ( ) : void
리턴 void

WriteMapBegin() 공개 메소드

public WriteMapBegin ( TMap map ) : void
map TMap
리턴 void

WriteMapEnd() 공개 메소드

public WriteMapEnd ( ) : void
리턴 void

WriteString() 공개 메소드

public WriteString ( String str ) : void
str String
리턴 void

프로퍼티 상세

context 보호되어 있는 프로퍼티

protected JSONBaseContext context
리턴 JSONBaseContext

contextStack 보호되어 있는 프로퍼티

protected Stack contextStack
리턴 Stack

reader 보호되어 있는 프로퍼티

protected LookaheadReader reader
리턴 LookaheadReader

utf8Encoding 보호되어 있는 프로퍼티

protected Encoding,System.Text utf8Encoding
리턴 System.Text.Encoding