Class OperaCookieInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.DataInputStream
-
- ch.supertomcat.supertomcatutils.http.cookies.opera.oldformat.containers.OperaCookieInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
public class OperaCookieInputStream extends DataInputStream
OperaCookieInputStream
-
-
Field Summary
Fields Modifier and Type Field Description static intO_COOKIE_AUTHENTICATE_1true wenn vorhandenstatic intO_COOKIE_AUTHENTICATE_2true wenn vorhandenstatic intO_COOKIE_AUTHENTICATE_3true wenn vorhandenstatic intO_COOKIE_AUTHENTICATE_4true wenn vorhandenstatic intO_COOKIE_COMMENTStringstatic intO_COOKIE_COMMENT_URLStringstatic intO_COOKIE_EXPIRESTimestatic intO_COOKIE_LAST_USEDTimestatic intO_COOKIE_NAMEStringstatic intO_COOKIE_PASSWORD_1true wenn vorhandenstatic intO_COOKIE_PASSWORD_2true wenn vorhandenstatic intO_COOKIE_PASSWORD_3true wenn vorhandenstatic intO_COOKIE_PASSWORD_4true wenn vorhandenstatic intO_COOKIE_PATH_PREFIX_1true wenn vorhandenstatic intO_COOKIE_PATH_PREFIX_2true wenn vorhandenstatic intO_COOKIE_PATH_PREFIX_3true wenn vorhandenstatic intO_COOKIE_PATH_PREFIX_4true wenn vorhandenstatic intO_COOKIE_PORTLISTStringstatic intO_COOKIE_PROTECTED_1true wenn vorhandenstatic intO_COOKIE_PROTECTED_2true wenn vorhandenstatic intO_COOKIE_PROTECTED_3true wenn vorhandenstatic intO_COOKIE_PROTECTED_4true wenn vorhandenstatic intO_COOKIE_RECEIVED_DOMAINStringstatic intO_COOKIE_RECEIVED_PATHStringstatic intO_COOKIE_SECURE_1true wenn vorhandenstatic intO_COOKIE_SECURE_2true wenn vorhandenstatic intO_COOKIE_SECURE_3true wenn vorhandenstatic intO_COOKIE_SECURE_4true wenn vorhandenstatic intO_COOKIE_SERVER_ONLY_1true wenn vorhandenstatic intO_COOKIE_SERVER_ONLY_2true wenn vorhandenstatic intO_COOKIE_SERVER_ONLY_3true wenn vorhandenstatic intO_COOKIE_SERVER_ONLY_4true wenn vorhandenstatic intO_COOKIE_STARTRecordstatic intO_COOKIE_THIRD_PARTY_1true wenn vorhandenstatic intO_COOKIE_THIRD_PARTY_2true wenn vorhandenstatic intO_COOKIE_THIRD_PARTY_3true wenn vorhandenstatic intO_COOKIE_THIRD_PARTY_4true wenn vorhandenstatic intO_COOKIE_VALUEStringstatic intO_COOKIE_VERSIONunsigned numericalstatic intO_DOMAIN_ACCEPTNumeric 1 = Alle von Domain akzeptieren 2 = Alle von Domain ablehnen 3 = Alle von Server akzeptieren 4 = Alle von Server ablehnenstatic intO_DOMAIN_END_1Domain End (0x0004 | MSB_VALUE)static intO_DOMAIN_END_2Domain End (0x0004 | MSB_VALUE)static intO_DOMAIN_END_3Domain End (0x0004 | MSB_VALUE)static intO_DOMAIN_END_4Domain End (0x0004 | MSB_VALUE)static longO_DOMAIN_END_LDomain End (0x0004 | MSB_VALUE)static intO_DOMAIN_NAMEStringstatic intO_DOMAIN_PATH_NOT_MATCHINGNumeric 1 = Ablehnen 2 = Automatisch akzeptierenstatic intO_DOMAIN_STARTDomain Start 0x0001static intO_DOMAIN_THIRD_PARTY_COOKIENumeric 1 = Alle von Domain akzeptieren 2 = Alle von Domain ablehnen 3 = Alle von Server akzeptieren 4 = Alle von Server ablehnenstatic intO_MSB_VALUE_1MSB Value for 1 Byte ID Tagsstatic intO_MSB_VALUE_2MSB Value for 2 Byte ID Tagsstatic intO_MSB_VALUE_3MSB Value for 3 Byte ID Tagsstatic intO_MSB_VALUE_4MSB Value for 4 Byte ID Tagsstatic longO_MSB_VALUE_LMSB Value for 3 Byte ID Tagsstatic intO_NULL_BYTENull bytestatic intO_PATH_END_1Path End (0x0005 | MSB_VALUE)static intO_PATH_END_2Path End (0x0005 | MSB_VALUE)static intO_PATH_END_3Path End (0x0005 | MSB_VALUE)static intO_PATH_END_4Path End (0x0005 | MSB_VALUE)static intO_PATH_NAMEStringstatic intO_PATH_STARTRecord-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description OperaCookieInputStream(InputStream in)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread(OperaCookieHeader och)Read headerlongread3ByteUnsignedInt()Read unsigned int consisting of 4 bytesintread3ByteUnsignedIntAsInt()Read unsigned int consisting of 4 bytes as int.longreadCookieRecord(OperaCookie operaCookie, int tagSize, int recordSize)Read cookie recordList<OperaDomain>readDomainComponents(int tagSize, int recordSize)Read domain componentslongreadDomainRecord(OperaDomain operaDomain, OperaDomain parentDomain, int tagSize, int recordSize)Read domain recordlongreadInt16Value(OperaShortValue value, int recordSize)Read Int16longreadInt32Value(OperaIntegerValue value, int recordSize)Read Int32longreadInt8Value(OperaByteValue value, int recordSize)Read Int8longreadPathRecord(OperaPath operaPath, OperaPath parentPath, int tagSize, int recordSize)Read path recordlongreadPayloadSize(int recordSize)Read Payload SizelongreadStringValue(OperaStringValue value, int recordSize)Read StringintreadTagID(int tagSize)Read Tag IDlongreadTimeValue(OperaTimeValue value, int recordSize)Read TimelongreadUInt16Value(OperaIntegerValue value, int recordSize)Read Int16longreadUInt32Value(OperaLongValue value, int recordSize)Read Int32longreadUInt8Value(OperaIntegerValue value, int recordSize)Read Int8longreadUnsignedInt()Read unsigned int consisting of 4 bytesintreadUnsignedIntAsInt()Read unsigned int consisting of 4 bytes as int.-
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Field Detail
-
O_MSB_VALUE_1
public static final int O_MSB_VALUE_1
MSB Value for 1 Byte ID Tags- See Also:
- Constant Field Values
-
O_MSB_VALUE_2
public static final int O_MSB_VALUE_2
MSB Value for 2 Byte ID Tags- See Also:
- Constant Field Values
-
O_MSB_VALUE_3
public static final int O_MSB_VALUE_3
MSB Value for 3 Byte ID Tags- See Also:
- Constant Field Values
-
O_MSB_VALUE_L
public static final long O_MSB_VALUE_L
MSB Value for 3 Byte ID Tags- See Also:
- Constant Field Values
-
O_MSB_VALUE_4
public static final int O_MSB_VALUE_4
MSB Value for 4 Byte ID Tags- See Also:
- Constant Field Values
-
O_NULL_BYTE
public static final int O_NULL_BYTE
Null byte- See Also:
- Constant Field Values
-
O_DOMAIN_START
public static final int O_DOMAIN_START
Domain Start 0x0001- See Also:
- Constant Field Values
-
O_DOMAIN_END_1
public static final int O_DOMAIN_END_1
Domain End (0x0004 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_DOMAIN_END_2
public static final int O_DOMAIN_END_2
Domain End (0x0004 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_DOMAIN_END_3
public static final int O_DOMAIN_END_3
Domain End (0x0004 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_DOMAIN_END_L
public static final long O_DOMAIN_END_L
Domain End (0x0004 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_DOMAIN_END_4
public static final int O_DOMAIN_END_4
Domain End (0x0004 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_DOMAIN_NAME
public static final int O_DOMAIN_NAME
String- See Also:
- Constant Field Values
-
O_DOMAIN_ACCEPT
public static final int O_DOMAIN_ACCEPT
Numeric 1 = Alle von Domain akzeptieren 2 = Alle von Domain ablehnen 3 = Alle von Server akzeptieren 4 = Alle von Server ablehnen- See Also:
- Constant Field Values
-
O_DOMAIN_PATH_NOT_MATCHING
public static final int O_DOMAIN_PATH_NOT_MATCHING
Numeric 1 = Ablehnen 2 = Automatisch akzeptieren- See Also:
- Constant Field Values
-
O_DOMAIN_THIRD_PARTY_COOKIE
public static final int O_DOMAIN_THIRD_PARTY_COOKIE
Numeric 1 = Alle von Domain akzeptieren 2 = Alle von Domain ablehnen 3 = Alle von Server akzeptieren 4 = Alle von Server ablehnen- See Also:
- Constant Field Values
-
O_PATH_START
public static final int O_PATH_START
Record- See Also:
- Constant Field Values
-
O_PATH_NAME
public static final int O_PATH_NAME
String- See Also:
- Constant Field Values
-
O_PATH_END_1
public static final int O_PATH_END_1
Path End (0x0005 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_PATH_END_2
public static final int O_PATH_END_2
Path End (0x0005 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_PATH_END_3
public static final int O_PATH_END_3
Path End (0x0005 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_PATH_END_4
public static final int O_PATH_END_4
Path End (0x0005 | MSB_VALUE)- See Also:
- Constant Field Values
-
O_COOKIE_START
public static final int O_COOKIE_START
Record- See Also:
- Constant Field Values
-
O_COOKIE_NAME
public static final int O_COOKIE_NAME
String- See Also:
- Constant Field Values
-
O_COOKIE_VALUE
public static final int O_COOKIE_VALUE
String- See Also:
- Constant Field Values
-
O_COOKIE_EXPIRES
public static final int O_COOKIE_EXPIRES
Time- See Also:
- Constant Field Values
-
O_COOKIE_LAST_USED
public static final int O_COOKIE_LAST_USED
Time- See Also:
- Constant Field Values
-
O_COOKIE_COMMENT
public static final int O_COOKIE_COMMENT
String- See Also:
- Constant Field Values
-
O_COOKIE_COMMENT_URL
public static final int O_COOKIE_COMMENT_URL
String- See Also:
- Constant Field Values
-
O_COOKIE_RECEIVED_DOMAIN
public static final int O_COOKIE_RECEIVED_DOMAIN
String- See Also:
- Constant Field Values
-
O_COOKIE_RECEIVED_PATH
public static final int O_COOKIE_RECEIVED_PATH
String- See Also:
- Constant Field Values
-
O_COOKIE_PORTLIST
public static final int O_COOKIE_PORTLIST
String- See Also:
- Constant Field Values
-
O_COOKIE_SECURE_1
public static final int O_COOKIE_SECURE_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SECURE_2
public static final int O_COOKIE_SECURE_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SECURE_3
public static final int O_COOKIE_SECURE_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SECURE_4
public static final int O_COOKIE_SECURE_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_VERSION
public static final int O_COOKIE_VERSION
unsigned numerical- See Also:
- Constant Field Values
-
O_COOKIE_SERVER_ONLY_1
public static final int O_COOKIE_SERVER_ONLY_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SERVER_ONLY_2
public static final int O_COOKIE_SERVER_ONLY_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SERVER_ONLY_3
public static final int O_COOKIE_SERVER_ONLY_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_SERVER_ONLY_4
public static final int O_COOKIE_SERVER_ONLY_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PROTECTED_1
public static final int O_COOKIE_PROTECTED_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PROTECTED_2
public static final int O_COOKIE_PROTECTED_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PROTECTED_3
public static final int O_COOKIE_PROTECTED_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PROTECTED_4
public static final int O_COOKIE_PROTECTED_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PATH_PREFIX_1
public static final int O_COOKIE_PATH_PREFIX_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PATH_PREFIX_2
public static final int O_COOKIE_PATH_PREFIX_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PATH_PREFIX_3
public static final int O_COOKIE_PATH_PREFIX_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PATH_PREFIX_4
public static final int O_COOKIE_PATH_PREFIX_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PASSWORD_1
public static final int O_COOKIE_PASSWORD_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PASSWORD_2
public static final int O_COOKIE_PASSWORD_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PASSWORD_3
public static final int O_COOKIE_PASSWORD_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_PASSWORD_4
public static final int O_COOKIE_PASSWORD_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_AUTHENTICATE_1
public static final int O_COOKIE_AUTHENTICATE_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_AUTHENTICATE_2
public static final int O_COOKIE_AUTHENTICATE_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_AUTHENTICATE_3
public static final int O_COOKIE_AUTHENTICATE_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_AUTHENTICATE_4
public static final int O_COOKIE_AUTHENTICATE_4
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_THIRD_PARTY_1
public static final int O_COOKIE_THIRD_PARTY_1
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_THIRD_PARTY_2
public static final int O_COOKIE_THIRD_PARTY_2
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_THIRD_PARTY_3
public static final int O_COOKIE_THIRD_PARTY_3
true wenn vorhanden- See Also:
- Constant Field Values
-
O_COOKIE_THIRD_PARTY_4
public static final int O_COOKIE_THIRD_PARTY_4
true wenn vorhanden- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OperaCookieInputStream
public OperaCookieInputStream(InputStream in)
Constructor- Parameters:
in- InputStream
-
-
Method Detail
-
read3ByteUnsignedInt
public long read3ByteUnsignedInt() throws IOExceptionRead unsigned int consisting of 4 bytes- Returns:
- unsigned int returned as a long, because Java has no unsigned int
- Throws:
IOException
-
read3ByteUnsignedIntAsInt
public int read3ByteUnsignedIntAsInt() throws IOExceptionRead unsigned int consisting of 4 bytes as int. Big values of Integer.MAX_VALUE will overflow, so this needs to be handled by the caller.- Returns:
- unsinged int
- Throws:
IOException
-
readUnsignedInt
public long readUnsignedInt() throws IOExceptionRead unsigned int consisting of 4 bytes- Returns:
- unsigned int returned as a long, because Java has no unsigned int
- Throws:
IOException
-
readUnsignedIntAsInt
public int readUnsignedIntAsInt() throws IOExceptionRead unsigned int consisting of 4 bytes as int. Big values of Integer.MAX_VALUE will overflow, so this needs to be handled by the caller.- Returns:
- unsinged int
- Throws:
IOException
-
readStringValue
public long readStringValue(OperaStringValue value, int recordSize) throws IOException
Read String- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readTimeValue
public long readTimeValue(OperaTimeValue value, int recordSize) throws IOException
Read Time- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readInt8Value
public long readInt8Value(OperaByteValue value, int recordSize) throws IOException
Read Int8- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readInt16Value
public long readInt16Value(OperaShortValue value, int recordSize) throws IOException
Read Int16- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readInt32Value
public long readInt32Value(OperaIntegerValue value, int recordSize) throws IOException
Read Int32- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readUInt8Value
public long readUInt8Value(OperaIntegerValue value, int recordSize) throws IOException
Read Int8- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readUInt16Value
public long readUInt16Value(OperaIntegerValue value, int recordSize) throws IOException
Read Int16- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readUInt32Value
public long readUInt32Value(OperaLongValue value, int recordSize) throws IOException
Read Int32- Parameters:
value- Value ContainerrecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
read
public int read(OperaCookieHeader och) throws IOException
Read header- Parameters:
och- OperaCookieHeader- Returns:
- Bytes read
- Throws:
IOException
-
readTagID
public int readTagID(int tagSize) throws IOExceptionRead Tag ID- Parameters:
tagSize- Tag Size (1 = uint8, 2 = uint16, 3 = uint24, 4 = uint32)- Returns:
- Tag ID or -1 if EOF
- Throws:
IOException
-
readPayloadSize
public long readPayloadSize(int recordSize) throws IOExceptionRead Payload Size- Parameters:
recordSize- Record Size (1 = uint8, 2 = uint16, 3 = uint24, 4 = uint32)- Returns:
- Payload Size
- Throws:
IOException
-
readDomainComponents
public List<OperaDomain> readDomainComponents(int tagSize, int recordSize) throws IOException
Read domain components- Parameters:
tagSize- Tag SizerecordSize- Record Size- Returns:
- List of domain components
- Throws:
IOException
-
readDomainRecord
public long readDomainRecord(OperaDomain operaDomain, OperaDomain parentDomain, int tagSize, int recordSize) throws IOException
Read domain record- Parameters:
operaDomain- DomainparentDomain- Parent Domain or null if no parenttagSize- Tag SizerecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readPathRecord
public long readPathRecord(OperaPath operaPath, OperaPath parentPath, int tagSize, int recordSize) throws IOException
Read path record- Parameters:
operaPath- PathparentPath- Parent Path or null if no parenttagSize- Tag SizerecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
readCookieRecord
public long readCookieRecord(OperaCookie operaCookie, int tagSize, int recordSize) throws IOException
Read cookie record- Parameters:
operaCookie- CookietagSize- Tag SizerecordSize- Record Size- Returns:
- Bytes Read
- Throws:
IOException
-
-