Questions tagged [pushbackinputstream]
7 questions
12
votes
1 answer
PushbackInputStream: Push back buffer is full
Why I am getting the following exception:
Exception in thread "main" java.io.IOException: Push back buffer is full
at java.io.PushbackInputStream.unread(PushbackInputStream.java:232)
at…

alien01
- 1,334
- 2
- 14
- 31
6
votes
1 answer
Reading an input stream twice without storing it in memory
With reference to the stackoverflow question it is said that the InputStream can be read multiple times with mark() and reset() provided by the InputStream or by using PushbackInputStream.
In all these cases the content of the stream is stored in…

Tom Taylor
- 3,344
- 2
- 38
- 63
4
votes
1 answer
mark() and reset() method in Java
According to the documentation,
void mark(int readlimit): Marks the current position in this input stream.
The mark method of PushbackInputStream does nothing.
void reset(): Repositions this stream to the position at the time the mark method was…

Jaimin Modi
- 1,530
- 4
- 20
- 72
2
votes
1 answer
Move constructor being called again c++
i just wrote a code for move constructor its being called again for value 2 passed into the pushback method
#include
#include
using namespace std;
class n{
int *ptr;
public:
n(int d):ptr{new int(d)}{cout<<"constuctor…

Tony Star
- 21
- 1
2
votes
1 answer
PushBackInputStream and DataInputStream, how to push back a double?
If I want to read ahead a byte,and push it back if it is not '<',I can do it like this:
PushbackInputStream pbin=new PushbackInputStream(new FileInputStream("1.dat"));
int b = pbin.read();
if(b!='<')
pbin.unread(b);
But if I want to push back a…

user6630815
- 65
- 8
2
votes
1 answer
PushbackInputStream - why exists
Why is it a good thing to push back bytes into the stream?
When I process the stream,I can ignore the byte or I can modify it,if I
want to do that on this way:
try(InputStream is = new FileInputStream("test.txt")){
int aByte;
…

jani777
- 53
- 4
0
votes
1 answer
Testing if a Java PushbackInputStream contains a string without ruining the stream pointer
I need to determine if a certain string is inside a PushbackInpuptStream but I need the stream pointer to be in the same point after this operation. This kind of stream does not support mark so how could one do this? Speed is not really a factor…

Mike2012
- 7,629
- 15
- 84
- 135