ucar.nc2.stream
Class NcStream

java.lang.Object
  extended by ucar.nc2.stream.NcStream

public class NcStream
extends Object

Defines the ncstream format, along with ncStream.proto.

 To regenerate ncStreamProto.java from ncStream.proto:
 cd c:/dev/tds4.2/thredds/cdm/src/main/java
 protoc --proto_path=. --java_out=. ucar/nc2/stream/ncStream.proto
 

See Also:
"http://www.unidata.ucar.edu/software/netcdf-java/stream/NcStream.html", "http://www.unidata.ucar.edu/software/netcdf-java/stream/NcstreamGrammer.html"

Field Summary
static byte[] MAGIC_DATA
           
static byte[] MAGIC_END
           
static byte[] MAGIC_ERR
           
static byte[] MAGIC_HEADER
           
static byte[] MAGIC_START
           
static byte[] MAGIC_VDATA
           
static byte[] MAGIC_VEND
           
 
Constructor Summary
NcStream()
           
 
Method Summary
static ArrayStructureBB decodeArrayStructure(StructureMembers sm, int[] shape, byte[] proto)
           
static DataType decodeDataType(NcStreamProto.DataType dtype)
           
static String decodeErrorMessage(NcStreamProto.Error err)
           
static Section decodeSection(NcStreamProto.Section proto)
           
static StructureData decodeStructureData(StructureMembers sm, byte[] proto)
           
static long encodeArrayStructure(ArrayStructure as, OutputStream os)
           
static NcStreamProto.DataType encodeDataType(DataType dtype)
           
static NcStreamProto.Error encodeErrorMessage(String message)
           
static NcStreamProto.Section encodeSection(Section section)
           
static boolean readAndTest(InputStream is, byte[] test)
           
static int readFully(InputStream is, byte[] b)
           
static int readVInt(InputStream is)
           
static int writeBytes(OutputStream out, byte[] b)
           
static int writeVInt(OutputStream out, int value)
           
static int writeVInt(WritableByteChannel wbc, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC_START

public static final byte[] MAGIC_START

MAGIC_HEADER

public static final byte[] MAGIC_HEADER

MAGIC_DATA

public static final byte[] MAGIC_DATA

MAGIC_VDATA

public static final byte[] MAGIC_VDATA

MAGIC_VEND

public static final byte[] MAGIC_VEND

MAGIC_ERR

public static final byte[] MAGIC_ERR

MAGIC_END

public static final byte[] MAGIC_END
Constructor Detail

NcStream

public NcStream()
Method Detail

encodeErrorMessage

public static NcStreamProto.Error encodeErrorMessage(String message)

encodeSection

public static NcStreamProto.Section encodeSection(Section section)

encodeArrayStructure

public static long encodeArrayStructure(ArrayStructure as,
                                        OutputStream os)
                                 throws IOException
Throws:
IOException

decodeArrayStructure

public static ArrayStructureBB decodeArrayStructure(StructureMembers sm,
                                                    int[] shape,
                                                    byte[] proto)
                                             throws IOException
Throws:
IOException

decodeStructureData

public static StructureData decodeStructureData(StructureMembers sm,
                                                byte[] proto)
                                         throws IOException
Throws:
IOException

writeBytes

public static int writeBytes(OutputStream out,
                             byte[] b)
                      throws IOException
Throws:
IOException

writeVInt

public static int writeVInt(OutputStream out,
                            int value)
                     throws IOException
Throws:
IOException

writeVInt

public static int writeVInt(WritableByteChannel wbc,
                            int value)
                     throws IOException
Throws:
IOException

readVInt

public static int readVInt(InputStream is)
                    throws IOException
Throws:
IOException

readFully

public static int readFully(InputStream is,
                            byte[] b)
                     throws IOException
Throws:
IOException

readAndTest

public static boolean readAndTest(InputStream is,
                                  byte[] test)
                           throws IOException
Throws:
IOException

decodeErrorMessage

public static String decodeErrorMessage(NcStreamProto.Error err)

decodeSection

public static Section decodeSection(NcStreamProto.Section proto)

encodeDataType

public static NcStreamProto.DataType encodeDataType(DataType dtype)

decodeDataType

public static DataType decodeDataType(NcStreamProto.DataType dtype)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.