File tree Expand file tree Collapse file tree
pg/src/main/java/org/bouncycastle/bcpg Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,5 +115,33 @@ static void writeTime(BCPGOutputStream pOut, long time)
115115 pOut .write ((byte )time );
116116 }
117117
118+ static long readTime (BCPGInputStream in )
119+ throws IOException {
120+ return (((long )in .read () << 24 ) | ((long ) in .read () << 16 ) | ((long ) in .read () << 8 ) | in .read ()) * 1000 ;
121+ }
122+
123+ static void write2OctetLength (OutputStream pOut , int len )
124+ throws IOException {
125+ pOut .write (len >> 8 );
126+ pOut .write (len );
127+ }
128+
129+ static int read2OctetLength (InputStream in )
130+ throws IOException {
131+ return (in .read () << 8 ) | in .read ();
132+ }
133+
134+ static void write4OctetLength (OutputStream pOut , int len )
135+ throws IOException {
136+ pOut .write (len >> 24 );
137+ pOut .write (len >> 16 );
138+ pOut .write (len >> 8 );
139+ pOut .write (len );
140+ }
141+
142+ static int read4OctetLength (InputStream in )
143+ throws IOException {
144+ return (in .read () << 24 ) | (in .read () << 16 ) | (in .read () << 8 ) | in .read ();
145+ }
118146
119147}
You can’t perform that action at this time.
0 commit comments