Package ucar.nc2.stream
Class NcStream
- java.lang.Object
-
- ucar.nc2.stream.NcStream
-
public class NcStream extends Object
Defines the ncstream format, along with ncStream.proto.- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/stream/NcStream.html", "https://www.unidata.ucar.edu/software/netcdf-java/stream/NcstreamGrammer.html"
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]
MAGIC_DATA
static byte[]
MAGIC_DATA2
static byte[]
MAGIC_DATACOV
static byte[]
MAGIC_END
static byte[]
MAGIC_ERR
static byte[]
MAGIC_HEADER
static byte[]
MAGIC_HEADERCOV
static byte[]
MAGIC_START
static byte[]
MAGIC_VDATA
static byte[]
MAGIC_VEND
static int
ncstream_data_version
-
Constructor Summary
Constructors Constructor Description NcStream()
-
Method Summary
-
-
-
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_DATA2
public static final byte[] MAGIC_DATA2
-
MAGIC_VDATA
public static final byte[] MAGIC_VDATA
-
MAGIC_VEND
public static final byte[] MAGIC_VEND
-
MAGIC_HEADERCOV
public static final byte[] MAGIC_HEADERCOV
-
MAGIC_DATACOV
public static final byte[] MAGIC_DATACOV
-
MAGIC_ERR
public static final byte[] MAGIC_ERR
-
MAGIC_END
public static final byte[] MAGIC_END
-
ncstream_data_version
public static final int ncstream_data_version
- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeAtt
public static NcStreamProto.Attribute.Builder encodeAtt(Attribute att)
-
encodeErrorMessage
public static NcStreamProto.Error encodeErrorMessage(String message)
-
encodeDataProto
public static NcStreamProto.Data encodeDataProto(String varname, DataType datatype, Section section, boolean deflate, int uncompressedLength)
-
encodeSection
public static NcStreamProto.Section encodeSection(Section section)
-
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(RandomAccessFile out, int value) throws IOException
- Throws:
IOException
-
writeVInt
public static int writeVInt(WritableByteChannel wbc, int value) throws IOException
- Throws:
IOException
-
writeVLong
public static int writeVLong(OutputStream out, long i) throws IOException
- Throws:
IOException
-
readVInt
public static int readVInt(InputStream is) throws IOException
- Throws:
IOException
-
readVInt
public static int readVInt(RandomAccessFile raf) 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
-
readAndTest
public static boolean readAndTest(RandomAccessFile raf, byte[] test) throws IOException
- Throws:
IOException
-
test
public static boolean test(byte[] b, byte[] test)
-
decodeErrorMessage
public static String decodeErrorMessage(NcStreamProto.Error err)
-
decodeAtt
public static Attribute decodeAtt(NcStreamProto.Attribute attp)
-
decodeSection
@Nonnull public static Section decodeSection(NcStreamProto.Section proto)
-
convertDataType
public static NcStreamProto.DataType convertDataType(DataType dtype)
-
convertDataType
public static DataType convertDataType(NcStreamProto.DataType dtype)
-
decodeStructureData
public static StructureData decodeStructureData(StructureMembers sm, ByteOrder bo, byte[] proto) throws IOException
- Throws:
IOException
-
-