Package javax.jmdns.impl
Class DNSOutgoing.MessageOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- javax.jmdns.impl.DNSOutgoing.MessageOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
- Enclosing class:
- DNSOutgoing
public static class DNSOutgoing.MessageOutputStream extends java.io.ByteArrayOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private int
_offset
private DNSOutgoing
_out
-
Constructor Summary
Constructors Constructor Description MessageOutputStream(int size, DNSOutgoing out)
Creates a new message stream, with a buffer capacity of the specified size, in bytes.MessageOutputStream(int size, DNSOutgoing out, int offset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
indexOfSeparator(java.lang.String aName)
(package private) void
writeByte(int value)
void
writeBytes(byte[] data)
(package private) void
writeBytes(byte[] data, int off, int len)
(package private) void
writeBytes(java.lang.String str, int off, int len)
(package private) void
writeInt(int value)
(package private) void
writeName(java.lang.String name)
(package private) void
writeName(java.lang.String name, boolean useCompression)
(package private) void
writeQuestion(DNSQuestion question)
(package private) void
writeRecord(DNSRecord rec, long now)
(package private) void
writeShort(int value)
(package private) void
writeUTF(java.lang.String str, int off, int len)
-
-
-
Field Detail
-
_out
private final DNSOutgoing _out
-
_offset
private final int _offset
-
-
Constructor Detail
-
MessageOutputStream
MessageOutputStream(int size, DNSOutgoing out)
Creates a new message stream, with a buffer capacity of the specified size, in bytes.- Parameters:
size
- the initial size.- Throws:
java.lang.IllegalArgumentException
- if size is negative.
-
MessageOutputStream
MessageOutputStream(int size, DNSOutgoing out, int offset)
-
-
Method Detail
-
writeByte
void writeByte(int value)
-
writeBytes
void writeBytes(java.lang.String str, int off, int len)
-
writeBytes
public void writeBytes(byte[] data)
-
writeBytes
void writeBytes(byte[] data, int off, int len)
-
writeShort
void writeShort(int value)
-
writeInt
void writeInt(int value)
-
writeUTF
void writeUTF(java.lang.String str, int off, int len)
-
writeName
void writeName(java.lang.String name)
-
writeName
void writeName(java.lang.String name, boolean useCompression)
-
indexOfSeparator
private static int indexOfSeparator(java.lang.String aName)
-
writeQuestion
void writeQuestion(DNSQuestion question)
-
writeRecord
void writeRecord(DNSRecord rec, long now)
-
-